#include "svg-jni.h"


using namespace gloox;
void RectFun(SVGPOINT p1,SVGPOINT p2,CSS cs)
{
	SVG_LOG("Oh!!!Calling RectFun...");
	SVG_LOG(cs.class_name);

}
void LineFun(SVGPOINT p1,SVGPOINT p2,CSS cs)
{
	SVG_LOG("Oh!!!Calling LineFun...");
	SVG_LOG(cs.class_name);
}

void PolyFun(SVGPOINT* points,int size,CSS cs)
{
	SVG_LOG("Oh!!!Calling PolyFun...");
	SVG_LOG(cs.class_name);
}

JNIEXPORT void JNICALL Java_cn_com_sina_finance_libsvg_drawtest
  (JNIEnv* env, jclass thiz, jstring file)
{
	char szFilename[128];
	memset(szFilename,0,sizeof(szFilename));
	char* pMsg	= NULL;
	pMsg	= (char *)(env->GetStringUTFChars(file,0));
	std::string strFile;
	strFile	= std::string(pMsg);
	SVGDocument* doc	= new SVGDocument();
	doc->registerLineFun(LineFun);
	doc->registerRectFun(RectFun);
	doc->registerPolygonFun(PolyFun);
	doc->loadSVG(strFile);
	delete doc;
	
}
